package com.example.test.proxy_two;

import java.lang.reflect.Proxy;

public class InvocationFactory {

    public static BaseService bulid(Class clazz) throws IllegalAccessException, InstantiationException {
        Invaction invaction = new Invaction((BaseService) clazz.newInstance());
        BaseService $proxy = (BaseService) Proxy.newProxyInstance(clazz.getClassLoader(),clazz.getInterfaces(),invaction);
        return $proxy;
    }

}
